let db = {
    set(key, value) {
        localStorage.setItem(key, value)
    },
    get(key) {
        return localStorage.getItem(key)
    },
    saveObject(key, value) {
        localStorage.setItem(key, JSON.stringify(value))
    },
    getUser(defaultValue = {}) {
        return JSON.parse(localStorage.getItem('user')) || defaultValue
    },
    remove(key) {
        localStorage.removeItem(key)
    },
    clear() {
        localStorage.clear()
    }
}

export default db
